<template>
  <div class="header">
    <div class="logo"><img src="../assets/logo2.png" alt=""></div>
    <div class="uesr">
      <el-button type="info" icon="el-icon-s-custom" circle @click="logins"></el-button>
      
    </div>
  </div>
</template>


<script>
export default {
  data(){
    return{
      typeStyle:"danger",
    }
  },
  methods:{
    logins(){
      let token = localStorage.getItem('token_z')
      if(!token){
      this.$router.push({
  path: "/login",

})}else{
    this.$confirm('退出账号？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '退出成功'
          });
          localStorage.removeItem("token_z"); 
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });          
        });
}
    }
  }
};
</script>

<style lang="less" scoped>
.header {
  height: 60px;
  background: rgb(84, 92, 100);
  overflow: hidden;
  // border: 1px solid saddlebrown;
}
.logo {
  float: left;
  img{
    width: 155px;
    height: 55px;
    margin: 10px 0px 0px 10px;
  }
}
.uesr {
  float: right;
  width: 40px;
  border: 1xp solid #000;
  padding-top: 10px;
  margin-right: 20px;
}
</style>